/*
Copyright 2011, CSE Shareware Foundation
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, 
are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, 
   this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, 
   this list of conditions and the following disclaimer in the documentation 
   and/or other materials provided with the distribution.
 * Neither the name of CSE Shareware Foundation nor the names of its contributors 
   may be used to endorse or promote products derived from this software without 
   specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "CseApi_.h"

TInt operator*(TInt i1,const TMngInt& i2)
{ return i1 * (TInt)i2; }

TInt operator/(TInt i1,const TMngInt& i2)
{ return i1 / (TInt)i2; }

TInt operator%(TInt i1,const TMngInt& i2)
{ return i1 % (TInt)i2; }

TInt operator+(TInt i1,const TMngInt& i2)
{ return i1 + (TInt)i2; }

TInt operator-(TInt i1,const TMngInt& i2)
{ return i1 - (TInt)i2; }

TInt operator<<(TInt i1,const TMngInt& i2)
{ return i1 << (TInt)i2; }

TInt operator>>(TInt i1,const TMngInt& i2)
{ return i1 >> (TInt)i2; }

TInt operator&(TInt i1,const TMngInt& i2)
{ return i1 & (TInt)i2; }

TInt operator|(TInt i1,const TMngInt& i2)
{ return i1 | (TInt)i2; }

TInt operator^(TInt i1,const TMngInt& i2)
{ return i1 ^ (TInt)i2; }

TInt operator*(const TMngInt& i1,const TMngInt& i2)
{ return (TInt)i1 * (TInt)i2; }

TInt operator/(const TMngInt& i1,const TMngInt& i2)
{ return (TInt)i1 / (TInt)i2; }

TInt operator%(const TMngInt& i1,const TMngInt& i2)
{ return (TInt)i1 % (TInt)i2; }

TInt operator+(const TMngInt& i1,const TMngInt& i2)
{ return (TInt)i1 + (TInt)i2; }

TInt operator-(const TMngInt& i1,const TMngInt& i2)
{ return (TInt)i1 - (TInt)i2; }

TInt operator<<(const TMngInt& i1,const TMngInt& i2)
{ return (TInt)i1 << (TInt)i2; }

TInt operator>>(const TMngInt& i1,const TMngInt& i2)
{ return (TInt)i1 >> (TInt)i2; }

TInt operator&(const TMngInt& i1,const TMngInt& i2)
{ return (TInt)i1 & (TInt)i2; }

TInt operator|(const TMngInt& i1,const TMngInt& i2)
{ return (TInt)i1 | (TInt)i2; }

TInt operator^(const TMngInt& i1,const TMngInt& i2)
{ return (TInt)i1 ^ (TInt)i2; }

TWint operator*(TWint i1,const TMngWint& i2)
{ return i1 * (TWint)i2; }

TWint operator/(TWint i1,const TMngWint& i2)
{ return i1 / (TWint)i2; }

TWint operator%(TWint i1,const TMngWint& i2)
{ return i1 % (TWint)i2; }

TWint operator+(TWint i1,const TMngWint& i2)
{ return i1 + (TWint)i2; }

TWint operator-(TWint i1,const TMngWint& i2)
{ return i1 - (TWint)i2; }

TWint operator<<(TWint i1,const TMngWint& i2)
{ return i1 << (TInt)(TWint)i2; }

TWint operator>>(TWint i1,const TMngWint& i2)
{ return i1 >> (TInt)(TWint)i2; }

TWint operator&(TWint i1,const TMngWint& i2)
{ return i1 & (TWint)i2; }

TWint operator|(TWint i1,const TMngWint& i2)
{ return i1 | (TWint)i2; }

TWint operator^(TWint i1,const TMngWint& i2)
{ return i1 ^ (TWint)i2; }

TWint operator*(const TMngWint& i1,const TMngWint& i2)
{ return (TWint)i1 * (TWint)i2; }

TWint operator/(const TMngWint& i1,const TMngWint& i2)
{ return (TWint)i1 / (TWint)i2; }

TWint operator%(const TMngWint& i1,const TMngWint& i2)
{ return (TWint)i1 % (TWint)i2; }

TWint operator+(const TMngWint& i1,const TMngWint& i2)
{ return (TWint)i1 + (TWint)i2; }

TWint operator-(const TMngWint& i1,const TMngWint& i2)
{ return (TWint)i1 - (TWint)i2; }

TWint operator<<(const TMngWint& i1,const TMngWint& i2)
{ return (TWint)i1 << (TWint)i2; }

TWint operator>>(const TMngWint& i1,const TMngWint& i2)
{ return (TWint)i1 >> (TWint)i2; }

TWint operator&(const TMngWint& i1,const TMngWint& i2)
{ return (TWint)i1 & (TWint)i2; }

TWint operator|(const TMngWint& i1,const TMngWint& i2)
{ return (TWint)i1 | (TWint)i2; }

TWint operator^(const TMngWint& i1,const TMngWint& i2)
{ return (TWint)i1 ^ (TWint)i2; }

TDouble operator-(TDouble f1,const TMngFloat& f2)
{ return f1 - (TDouble)f2; }

TDouble operator*(TDouble f1,const TMngFloat& f2)
{ return f1 * (TDouble)f2; }

TDouble operator/(TDouble f1,const TMngFloat& f2)
{ return f1 / (TDouble)f2; }

TDouble operator+(TDouble f1,const TMngFloat& f2)
{ return f1 + (TDouble)f2; }

TDouble operator-(const TMngFloat& f1,const TMngFloat& f2)
{ return (TDouble)f1 - (TDouble)f2; }

TDouble operator*(const TMngFloat& f1,const TMngFloat& f2)
{ return (TDouble)f1 * (TDouble)f2; }

TDouble operator/(const TMngFloat& f1,const TMngFloat& f2)
{ return (TDouble)f1 / (TDouble)f2; }

TDouble operator+(const TMngFloat& f1,const TMngFloat& f2)
{ return (TDouble)f1 + (TDouble)f2; }

TCharArray operator+(TXchar x, const TMngStr& y)
{ return x + y.sArray(); }

TCharArray operator+(const TXchar *x, const TMngStr& y)
{ return x + y.sArray(); }

TCharArray operator+(const TCharArray& x, const TMngStr& y)
{ return x + y.sArray(); }

TBool operator==(const TXchar *x, const TMngStr& y)
{ return x == y.sArray(); }

TBool operator==(const TCharArray& x, const TMngStr& y)
{ return x == y.sArray(); }

TBool operator!=(const TXchar *x, const TMngStr& y)
{ return x != y.sArray(); }

TBool operator!=(const TCharArray& x, const TMngStr& y)
{ return x != y.sArray(); }

TBool operator>(const TXchar *x, const TMngStr& y)
{ return x > y.sArray(); }

TBool operator>(const TCharArray& x, const TMngStr& y)
{ return x > y.sArray(); }

TBool operator>=(const TXchar *x, const TMngStr& y)
{ return x >= y.sArray(); }

TBool operator>=(const TCharArray& x, const TMngStr& y)
{ return x >= y.sArray(); }

TBool operator<(const TXchar *x, const TMngStr& y)
{ return x < y.sArray(); }

TBool operator<(const TCharArray& x, const TMngStr& y)
{ return x < y.sArray(); }

TBool operator<=(const TXchar *x, const TMngStr& y)
{ return x <= y.sArray(); }

TBool operator<=(const TCharArray& x, const TMngStr& y)
{ return x <= y.sArray(); }

TBool operator==(const TIntArray& x, const TMngTier& y)
{ return x == y.tArray(); }

TBool operator!=(const TIntArray& x, const TMngTier& y)
{ return x != y.tArray(); }

TBool operator>(const TIntArray& x, const TMngTier& y)
{ return x > y.tArray(); }

TBool operator>=(const TIntArray& x, const TMngTier& y)
{ return x >= y.tArray(); }

TBool operator<(const TIntArray& x, const TMngTier& y)
{ return x < y.tArray(); }

TBool operator<=(const TIntArray& x, const TMngTier& y)
{ return x <= y.tArray(); }

TBool operator==(const TObjArray& x, const TMngBuff& y)
{ return x == y.bArray(); }

TBool operator!=(const TObjArray& x, const TMngBuff& y)
{ return x != y.bArray(); }

TBool operator>(const TObjArray& x, const TMngBuff& y)
{ return x > y.bArray(); }

TBool operator>=(const TObjArray& x, const TMngBuff& y)
{ return x >= y.bArray(); }

TBool operator<(const TObjArray& x, const TMngBuff& y)
{ return x < y.bArray(); }

TBool operator<=(const TObjArray& x, const TMngBuff& y)
{ return x <= y.bArray(); }

TBool operator==(const TEntryArray& x, const TMngDict& y)
{ return x == y.dArray(); }

TBool operator!=(const TEntryArray& x, const TMngDict& y)
{ return x != y.dArray(); }

TInt operator*(TInt i1,const TIntProp& i2)
{ return i1 * (TInt)i2; }

TInt operator/(TInt i1,const TIntProp& i2)
{ return i1 / (TInt)i2; }

TInt operator%(TInt i1,const TIntProp& i2)
{ return i1 % (TInt)i2; }

TInt operator+(TInt i1,const TIntProp& i2)
{ return i1 + (TInt)i2; }

TInt operator-(TInt i1,const TIntProp& i2)
{ return i1 - (TInt)i2; }

TInt operator<<(TInt i1,const TIntProp& i2)
{ return i1 << (TInt)i2; }

TInt operator>>(TInt i1,const TIntProp& i2)
{ return i1 >> (TInt)i2; }

TInt operator&(TInt i1,const TIntProp& i2)
{ return i1 & (TInt)i2; }

TInt operator|(TInt i1,const TIntProp& i2)
{ return i1 | (TInt)i2; }

TInt operator^(TInt i1,const TIntProp& i2)
{ return i1 ^ (TInt)i2; }

TWint operator*(TWint i1,const TWintProp& i2)
{ return i1 * (TWint)i2; }

TWint operator/(TWint i1,const TWintProp& i2)
{ return i1 / (TWint)i2; }

TWint operator%(TWint i1,const TWintProp& i2)
{ return i1 % (TWint)i2; }

TWint operator+(TWint i1,const TWintProp& i2)
{ return i1 + (TWint)i2; }

TWint operator-(TWint i1,const TWintProp& i2)
{ return i1 - (TWint)i2; }

TWint operator<<(TWint i1,const TWintProp& i2)
{ return i1 << (TInt)(TWint)i2; }

TWint operator>>(TWint i1,const TWintProp& i2)
{ return i1 >> (TInt)(TWint)i2; }

TWint operator&(TWint i1,const TWintProp& i2)
{ return i1 & (TWint)i2; }

TWint operator|(TWint i1,const TWintProp& i2)
{ return i1 | (TWint)i2; }

TWint operator^(TWint i1,const TWintProp& i2)
{ return i1 ^ (TWint)i2; }

TDouble operator*(TDouble f1,const TFloatProp& f2)
{ return f1 * (TDouble)f2; }

TDouble operator/(TDouble f1,const TFloatProp& f2)
{ return f1 / (TDouble)f2; }

TDouble operator+(TDouble f1,const TFloatProp& f2)
{ return f1 + (TDouble)f2; }

TDouble operator-(TDouble f1,const TFloatProp& f2)
{ return f1 - (TDouble)f2; }

TCharArray operator+(TXchar x, const TStrProp& y)
{
    TCharArray s(x);
    s += (const TXchar*)y;
    return TCharArray(CUT_FROM,s);
}

TCharArray operator+(const TXchar *x, const TStrProp& y)
{ 
    TCharArray s(x);
    s += (const TXchar*)y;
    return TCharArray(CUT_FROM,s);
}

TCharArray operator+(const TCharArray& x, const TStrProp& y)
{
    return x + (const TXchar*)y;
}

TBool operator==(const TXchar *x, const TStrProp& y)
{
    TCharArray s(x);
    return s.compare((const TXchar*)y) == 0;
}

TBool operator==(const TCharArray& x, const TStrProp& y)
{
    return x == (const TXchar*)y;
}

TBool operator!=(const TXchar *x, const TStrProp& y)
{
    TCharArray s(x);
    return s.compare((const TXchar*)y) != 0;
}

TBool operator!=(const TCharArray& x, const TStrProp& y)
{
    return x != (const TXchar*)y;
}

TBool operator>(const TXchar *x, const TStrProp& y)
{
    TCharArray s(x);
    return s.compare((const TXchar*)y) > 0;
}

TBool operator>(const TCharArray& x, const TStrProp& y)
{
    return x > (const TXchar*)y;
}

TBool operator>=(const TXchar *x, const TStrProp& y)
{
    TCharArray s(x);
    return s.compare((const TXchar*)y) >= 0;
}

TBool operator>=(const TCharArray& x, const TStrProp& y)
{
    return x >= (const TXchar*)y;
}

TBool operator<(const TXchar *x, const TStrProp& y)
{
    TCharArray s(x);
    return s.compare((const TXchar*)y) < 0;
}

TBool operator<(const TCharArray& x, const TStrProp& y)
{
    return x < (const TXchar*)y;
}

TBool operator<=(const TXchar *x, const TStrProp& y)
{
    TCharArray s(x);
    return s.compare((const TXchar*)y) <= 0;
}

TBool operator<=(const TCharArray& x, const TStrProp& y)
{
    return x <= (const TXchar*)y;
}
